﻿using System.Collections.Generic;

namespace SimpleORM
{
    public static class StackTExtension
    {
        public static List<T> ToList<T>(this Stack<T> source)
        {
            if (source == null)
                return null;

            List<T> list = new List<T>();
            while (source.Count > 0)
                list.Add(source.Pop());

            return list;

        }
    }
}
